<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
        .radio-inline input[type=radio] {
            margin-top: 4px
        }
    </style>
</head>

<body style="color:#333;padding:3px;overflow-x: auto;font-size:13px">
    <!-- 标题 -->
    <div class="page-heade">
      <h1 class="title_color">常规促销申请明细</h1>
    </div>
    <!-- 标题 -->
    <div >
    <table class="table-bordered table">
        <tr>
          <td><a href="{:url('Other/formalbacklogdetail')}" class="btn btn-sm btn-primary">审批决策宝</a></td>
        </tr>
    </table>
    <form action="" class="form-inline">
      <table class="table row-margin-top table-bordered bud_hei">
          <tr>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >编号</label></td>
             <td>201706150003</td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >创建时间</label></td>
             <td>2017-06-15 13:42</td>
          </tr>
       <tr>
             <td><label for="" class="form-label" >申请人</label></td>
             <td><a href="javascript:;">余通(华中大区经理)</a></td>
             <td><label for="" class="form-label" >部门</label></td>
             <td>华南大区</td>
          </tr>
           <tr>
             <td><label for="" class="form-label" >状态</label></td>
             <td>拆分人审批</td>
             <td><label for="" class="form-label" >审批时间</label></td>
             <td>2017-06-15 13:42</td>
          </tr>
         <tr>
             <td><label for="" class="form-label" >主题</label></td>
             <td colspan="3">广州端午节促销</td>
         </tr>
         <tr>
             <td><label for="" class="form-label" >经销商名称</label></td>
             <td colspan="3"><span class="font-bold">销路通有限公司<a href="AgencyYijuDetail.html"><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true"></span></a></span></td> 
         </tr>
           <tr>
             <td><label for="" class="form-label" >经销商基本信息</label></td>
             <td colspan="3">所属分区：<span>东南大区</span> 所属省份：<span>福建省</span> 所属城市：<span>福州市</span> 性质：<span>直营</span></td>
         </tr>
      </table>
       <table class="table table-bordered text-center bud_hei" style="margin-top: 1px;">
         <thead>
          <tr class="info">
             <th class="text-center" style="min-width:100px;width: 100px;" rowspan="2">审批人</th>
             <th class="text-center" style="min-width:80px" rowspan="2">序号</th>
            <th class="text-center" style="min-width:140px" rowspan="2">明细编号</th>
            <th class="text-center" rowspan="2" style="min-width: 180px">系统名称</th>
            <th class="text-center" rowspan="2" style="min-width: 70px">负责人</th>
            <th class="text-center" rowspan="2" style="min-width: 180px">网点名称</th>
            <th class="text-center" rowspan="2" style="min-width: 180px">产品系列</th>
            <th class="text-center" rowspan="2" style="min-width: 180px">促销产品</th>
            <th class="text-center" style="min-width: 100px" rowspan="2">促销执行时间</th>
            <th class="text-center" style="min-width: 100px" rowspan="2">预计核销时间</th>
             <th class="text-center" colspan="2">预计销售量</th>
             <th class="text-center" style="min-width: 120px" rowspan="2">需补差销售量</th>
             <th class="text-center" style="min-width: 80px" rowspan="2">标准<br>出厂价</th>
             <th class="text-center" style="min-width: 80px" rowspan="2">经销商<br>原供货价</th>
             <th class="text-center" style="min-width: 80px" rowspan="2">经销商<br>现供货价</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">经销商<br>折价率</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">经销商总<br>折价金额</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">经销商<br>毛利率</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">网点<br>正常供货价</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">网点<br>促销供货价</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">网点<br>折价率</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">网点<br>折价金额</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">原零售价</th>
            <th class="text-center" style="min-width: 100px" rowspan="2">活动期零售价</th>
            <th class="text-center" style="min-width: 100px" rowspan="2">网点<br>毛利率</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">费用名称</th>
            <th class="text-center" style="min-width: 180px" rowspan="2">未税费用金额(元)</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">税率</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">含税费用金额(元)</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">实际投入费用(元)</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">费用描述</th>
            <th class="text-center" style="min-width: 120px;width: 120px" rowspan="2">费用支付方式</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">费用小计(元)</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">预计<br>费用率</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">基准销量</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">预计<br>ROI</th>
            <th class="text-center" style="min-width: 40px" rowspan="2">备注</th>
            <th class="text-center" style="min-width: 180px" rowspan="2">操作</th>
            <th class="text-center" style="min-width: 80px" rowspan="2">是否要求<br>核查</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">费用计入部门</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">计入部门修改人</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">费用计入方案</th>
            <th class="text-center" style="min-width: 120px" rowspan="2">计入方案修改人</th>
          </tr>
           <tr class="info">
            <th class="text-center" style="min-width: 60px">单品</th>
            <th class="text-center" style="min-width: 80px">需补差销量</th>
           </tr>
         </thead>
        <tr class="text-left text-success">
          <td>张晓明修改过</td>
          <td>1<span class="colorRed duigou" title="此单申请时间在活动开始时间之后">补单</span></td>
          <td><a href="javascript:;">201706150003_1<span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td>
          <td>广州酒家演示系统</td>
          <td>余通</td>
          <td><a href="javascript:;">高德吉之岛分店<span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td>
          <td><a href="javascript:;">利口福-粽子类-粽子类<span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td>
          <td><span class="glyphicon glyphicon-warning-sign jinchang" aria-hidden="true" title="此条码在申请时未进场"></span>测试234<a href="ROIjcyj.html"><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td>
          <td>2017-06-15 <br>2017-06-20</td>
          <td>2017-08-20</td>
          <td>5.00箱</td>
          <td class="ObjectNum text-right">2000</td>
          <td class="text-right"></td>
          <td class="text-right">25.00元/袋</td>
          <td class="text-right">25.00元/袋</td>
          <td class="text-right">25.00元/袋</td>
          <td class="text-right">0.00% OFF</td>
          <td class="ObjectNum text-right"></td>
          <td class="text-right">20.00%</td>
          <td class="text-right">30.00元/袋</td>
          <td class="text-right">30.00元/袋</td>
          <td class="text-right">0.00% OFF</td>
          <td class="ObjectNum text-right"></td>
          <td class="text-right">30.00元/袋</td>
          <td class="text-right">29.80元/袋</td>
          <td class="text-right">-0.67% </td>
          <td>堆头费</td>
          <td>
            375.00/  
                
                  <input id="listMoney1" type="text" style="width: 80px;" name="listMoney" value="375.0" onblur="editorInput(this)"  class="zhiDuInput form-control" readonly="">
                  <img id="weiShuiEditImg1" width="20px" height="20px" style="cursor: pointer; display: inline;vertical-align: bottom;" title="修改" src="__STATIC__/layout/img/xiugai.png" onclick="editWeiShui(this);">
                    
                   <img id="weiShuiQueRenImg1" width="30px" height="20px" onclick="saveWeiShui(this);" style="cursor: pointer; display:none ;vertical-align: bottom;" title="保存" src="__STATIC__/layout/img/baocun.png" >
                    
           <!--     <img id="jiaZaiImg1" width="20px" height="20px" style="display: none;" src="/xiaolutong/web/images/process/072.gif"> -->
                   <br>
                   <span id="editWeiShuiMsg1" style="color: red; display: none;"></span>
                   
                   <span id="editWeiShuiMsgOK1" style="color: green; display: none;">修改成功！</span>
                    
                
          </td>
          <td>否</td>
          <td>6.00%</td>
          <td class="text-right ObjectNum">397.50</td>
          <td class="text-right ObjectNum">397.50</td>
          <td>
            <select name="" id="" class="form-control select" style="color:#333" >
                <option value="0">请选择</option>
                <option value="1">转账</option>
                <option value="2">账扣</option>
                <option value="3">票扣</option>
                <option value="4">现金支付</option>
                <option value="5">预付</option>
            </select>
          </td>
          <td class="text-right ObjectNum">397.50</td>  
          <td class="text-right">19.88%</td>
          <td class="text-right ObjectNum">0</td>
          <td class="text-right">251.57%</td>
          <td></td>
          <td class="text-left">
            <div class="form-group">
                   <label class="radio-inline" for="agree">
                    <input type="radio" name="isOrNo" value="agree" >同意
                </label>
               <label class="radio-inline" for="noPass">
                  <input type="radio" checked name="isOrNo" value="noPass">否决
               </label>
            </div><br>
            <span id="editCaozuoOK1" style="color: green; display: none;">修改成功！</span>
          </td>
          <td class="text-center"><input type="checkbox" class="form-control" name="items" id=""></td>
          <td>
            <select name="" id="" class="form-control select" style="color:#333">
                <option value="0">华南大区</option>
                <option value="1">华南大区</option>
                <option value="2">华中大区</option>
                <option value="3">华北大区</option>
                <option value="4">西南大区</option>
                <option value="5">西北大区</option>
                <option value="6">东南大区</option>
                <option value="7">董事会</option>
            </select>
          </td>
          <td></td>
          <td>
            <select name="" id="" class="form-control select" style="color:#333">
                <option value="0">请选择</option>
                <option value="1">冬季促销活动</option>
                <option value="2">千店陈列活动</option>
                <option value="3">完美门店行动</option>
            </select>
          </td>
          <td></td>
        </tr>
      </table>
       <table class="table table-bordered" style="margin:0;padding: 0">
          <tr>
            <td class="font-bold">本申请中包含<span>1</span>个网点，其中促销折让与折扣：<span class="ObjectNum">22656</span>元；总费用：<span class="ObjectNum">22656</span>元。总预计销量：<span class="ObjectNum">203904</span>元；总费用率：<span class="ObjectNum">11.11</span>%；总ROI: <span class="ObjectNum">297</span>%；<a href="javascript:;" class="btn btn-sm btn-primary" id="yasuofeiyong">压缩费用</a></td>
          </tr>
      </table>
      <table class="table-bordered table row-margin-top">
        <tr>
          <td style="width: 140px;height: 100px;">审批意见</td>
          <td><textarea name="" id="" class="form-control" style="width: 70%;height: 96px;resize: none;"></textarea></td>
        </tr>
        <tr>
          <td colspan="2"><label for="isfunkui"><input type="checkbox" class="" name="" id="isfunkui">是否需要反馈</label><span class="colorRed">(如需反馈请勾选)</span></td>
        </tr>
      </table>
        <table class="table-bordered row-margin-top table text-center bud_hei" id="flowTab">
            <tr class="info font-bold">
              <td colspan="2" class="text-left">请选择流程后续的审批领导 <a class="btn-sm btn btn-info" href="{:url('Other/setmyqueckline')}">设置我的快速拆分路径</a></td>
            </tr>
            <tr>
              <td colspan="2" class="text-left">快速拆分路径选择： <a href="javascript:;" class="btn-warning btn-sm btn">大于5000</a>
              <a href="javascript:;" class="btn-info btn-sm btn">小于5000</a>    </td>
            </tr>
            <tr>
              <td>审批人</td>
              <td><button class="btn btn-sm btn-primary" id="addShenpiMan" type="button">添加审批人</button></td>
            </tr>
            <tr>
              <td>     <div class="input-group text-center">
                            <input id="area_id" type="text" placeholder="请输入关键字或空格查询"
                                   class="form-control" value="" style="min-width: 300px;width: 300px">
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                   
      </td>
              <td> <a href="javascript:;" id="select_area" class="btn btn-primary btn-sm">选择</a></td>
            </tr>
    </table>
         <div class="row sub_btn" style="width:100%;text-align:center;padding: 20px 0">
        <input type="submit" class="btn btn-success" value="保存为草稿">
        <input type="submit" class="btn btn-info" value="保存并提交流程">
        <input type="button" class="btn btn-warning" value="返回" onclick="back()">
    </div>
</form>
 
<!-- 压缩费用 start-->
<div id="yasuo" style="display: none;" class="ibox ibox-content">
    <h1 class="title_color">
        常规促销申请压缩费用
    </h1>
    <form action="" id="form1">
     <!--    <input type="hidden" name="ti_id" value="{:request()->param('id')}"> -->
    <table class="table row-margin-top table-bordered text-center bud_hei">
        <tr class="info">
            <th>费用科目</th>
            <th>网点数</th>
            <th>产品数</th>
            <th>申请金额(元)</th>
            <th>核准金额(元)</th>
        </tr>
        <tr>
            <td>堆头费</td>
            <td><a href="javascript:;" class="netnum">2</a></td>
            <td><a href="javascript:;" class="pronum">2</a></td>
            <td class="ObjectNum text-right">1590</td>
            <td><input type="text" name="hzje" class="form-control"></td>
        </tr>
      <!--   {/volist} -->
        <tr>
            <td colspan="5">
                备注：上述核准金额为：被允许的最大实际投入金额。 实际投入金额为实际扣除预算的金额。当客户提供的发票为普通发票或增值税普通发票（不可抵扣）时， 则实际投入金额为发票含税（价税合计）金额。当客户提供的发票为增值税专用发票（可抵扣）时， 则实际投入金额为发票未税（不含税）金额。
            </td>
        </tr>
    </table>
    <div class="row">
      <div class="text-center padding-10 trTotal">核准金额合计：<span class="colorRed font-bold">2222.60</span> 元</div>
    </form>
</div>
<!-- 压缩费用 end-->

    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script> 
     <script src="__STATIC__/layout/js/common.js"></script>
    <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <script>
           $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
              });
        
        function back(){
          history.go(-1)
        }

        function editWeiShui(which){

          // console.log($(this))
          $(which).css("display","none");
          $(which).siblings('img').css("display",'inline');
          $("#editWeiShuiMsgOK1").css("display",'block');
          $(which).siblings("#listMoney1").removeAttr("readonly");
        };
        function saveWeiShui(which){
          $(which).css("display","none");
          $(which).siblings('img').css("display",'inline');
          $("#editWeiShuiMsgOK1").css("display",'block');
          $(which).siblings("#listMoney1").attr("readonly","readonly");
        }
        function editorInput(which){
            $(which).attr("readonly","readonly");
        }

        $("#yasuofeiyong").click(function(){
            layer.open({
                type: 1,
                title: '压缩费用',
                area: ['700px', '500px'],
                fixed: false, //不固定
                maxmin: true,
                content: $('#yasuo'),
                btn:['确定','返回'],
                yes:function (i,o) {
                    var param = $('#form1').serialize()
                    $.post('{:url("ysfy_fcg")}',param,function (data) {
                        if(data.success){
                            swal({title:data.msg},function () {
                                layer.close(i)
                            })
                        }else{
                            swal(data.msg)
                        }
                    },'json')
                }
            });
        })
  $(".pronum").click(function(){
         var str='<div id="pronum" class="ibox-content">'+
  '<h2 class="title_color text-center">产品列表</h2>'+
  '<form action="#" id="form0">'+
      '<table class="table table-bordered">'+
        '<tr>'+
          '<td>No.</td>'+
          '<td>产品编号</td>'+
          '<td>产品名称</td>'+
        '</tr>'+
        '<tr>'+
          '<td>1</td>'+
          '<td>1021232</td>'+
          '<td>07肇庆裹蒸棕</td>'+
        '</tr>'+
        ' <tr>'+
          '<td>2</td>'+
          '<td>1021232</td>'+
          '<td>07肇庆裹蒸棕</td>'+
        '</tr>'+
      '</table>'+
  '</form>'+
'</div>'
            layer.open({
                type: 1,
                title: '产品明细列表',
                area: ['500px', '400px'],
                fixed: false, //不固定
                maxmin: true,
                content:str,
            });
            return false;
        })
  $(".netnum").click(function(){
         var str='<div id="pronum" class="ibox-content">'+
  '<h2 class="title_color text-center">网点列表</h2>'+
  '<form action="#" id="form0">'+
      '<table class="table table-bordered">'+
        '<tr>'+
          '<td>No.</td>'+
          '<td>网点编号</td>'+
          '<td>网点名称</td>'+
        '</tr>'+
        '<tr>'+
          '<td>1</td>'+
          '<td>1021232</td>'+
          '<td>万家天河东分店</td>'+
        '</tr>'+
        ' <tr>'+
          '<td>2</td>'+
          '<td>1021232</td>'+
          '<td>高德吉之岛分店</td>'+
        '</tr>'+
      '</table>'+
  '</form>'+
'</div>'
            layer.open({
                type: 1,
                title: '网点明细列表',
                area: ['500px', '400px'],
                fixed: false, //不固定
                maxmin: true,
                content:str,
            });
            return false;
        })


  /*请输入关键字或空格查询*/
  var jieshou = $("#area_id");
 sousuo(jieshou);
       function sousuo(id){
            id.bsSuggest({
            allowNoKeyword: false, //是否允许无关键字时请求数据
            multiWord: true, //以分隔符号分割的多关键字支持
            separator: ",", //多关键字支持时的分隔符，默认为空格
            getDataMethod: "url", //获取数据的方式，总是从 URL 获取
            url: 'http://unionsug.baidu.com/su?p=3&t=' + (new Date()).getTime() + '&wd=',
            /*优先从url ajax 请求 json 帮助数据，注意最后一个参数为关键字请求参数*/
            jsonp: 'cb',
            /*如果从 url 获取数据，并且需要跨域，则该参数必须设置*/
            processData: function (json) { // url 获取数据时，对数据的处理，作为 getData 的回调函数
                var i, len, data = {
                    value: []
                };
                if (!json || !json.s || json.s.length === 0) {
                    return false;
                }

                // console.log(json);
                len = json.s.length;

                jsonStr = "{'value':[";
                for (i = 0; i < len; i++) {
                    data.value.push({
                        word: json.s[i]
                    });
                }
                data.defaults = 'baidu';

                //字符串转化为 js 对象
                return data;
            }
        });

          }


$("#addShenpiMan").click(function(){
  var str = '<tr><td><div class="input-group"><input id="area_id" type="text" placeholder="请输入关键字或空格查询" class="form-control" value="" style="min-width: 300px;width: 300px"><div class="input-group-btn"><ul class="dropdown-menu dropdown-menu-right" role="menu"></ul></div></div></div></td><td> <a href="javascript:;" id="select_area" class="btn btn-primary btn-sm">选择</a><span></span> <button class="btn btn-sm btn-danger delthis" type="button">删除</button></td></tr>'
  $("#flowTab tbody").append(str);
})

    $(document).on("click",".delthis",function(){
              var _$this=this
              console.log(_$this)
                swal({ 
              title: "", 
              text: "确定删除！", 
              type: "warning",
              showCancelButton: true, 
              confirmButtonColor: "#DD6B55",
              confirmButtonText: "确定", 
              cancelButtonText: "取消",
              closeOnConfirm: false, 
              closeOnCancel: false
            },
            function(isConfirm){ 
              if (isConfirm) { 
                // console.log(_$this);
                $(_$this).closest("tr").remove();
                swal("删除！", "成功","success"); 
               
              } else { 
                swal("取消！", "","error"); 
              } 
          });
             });

    </script>
</body>

</html>
